<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
   
    //1 window
    // fn();
    //2 object 构造函数对象
    //  new fn();
    //3  是谁的指向谁
    // document.onclick = fn;
    //4 改变  call/apply/bind里面的第一个参数
    // fn.call("你好")

    //5 箭头函数

    //6  class中指向类本身
    var  fn  =()=>{
        alert(this+"b")
    }
    fn();
    

    document.onclick = function () {

        window.fn();
    }
    // var a = "abc";
    // alert(window.a);
    function fn() {
        alert(this+"a");
    }

</script>

</html>